Optimal. Leaf size=71 \[ -8 a^4 x+\frac {4 i a^4 \log (\cos (c+d x))}{d}+\frac {4 i a^4 \log (\sin (c+d x))}{d}-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3634, 12, 3622,
3556} \begin {gather*} \frac {4 i a^4 \log (\sin (c+d x))}{d}+\frac {4 i a^4 \log (\cos (c+d x))}{d}-8 a^4 x-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 3556
Rule 3622
Rule 3634
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+i a \tan (c+d x))^4 \, dx &=-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}-\int -4 i a^2 \cot (c+d x) (a+i a \tan (c+d x))^2 \, dx\\ &=-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (4 i a^2\right ) \int \cot (c+d x) (a+i a \tan (c+d x))^2 \, dx\\ &=-8 a^4 x-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}+\left (4 i a^4\right ) \int \cot (c+d x) \, dx-\left (4 i a^4\right ) \int \tan (c+d x) \, dx\\ &=-8 a^4 x+\frac {4 i a^4 \log (\cos (c+d x))}{d}+\frac {4 i a^4 \log (\sin (c+d x))}{d}-\frac {\cot (c+d x) \left (a^2+i a^2 \tan (c+d x)\right )^2}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(151\) vs. \(2(71)=142\).
time = 1.55, size = 151, normalized size = 2.13 \begin {gather*} \frac {a^4 \csc (c) \csc (c+d x) \sec (c) \sec (c+d x) \left (6 d x \cos (4 c+2 d x)-i \cos (4 c+2 d x) \log \left (\cos ^2(c+d x)\right )+\cos (2 d x) \left (-6 d x+i \log \left (\cos ^2(c+d x)\right )+i \log \left (\sin ^2(c+d x)\right )\right )-i \cos (4 c+2 d x) \log \left (\sin ^2(c+d x)\right )+2 \sin (2 d x)+4 \text {ArcTan}(\tan (5 c+d x)) \sin (2 c) \sin (2 (c+d x))\right )}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 80, normalized size = 1.13
method | result | size |
risch | \(\frac {16 a^{4} c}{d}-\frac {4 i a^{4}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}+\frac {4 i a^{4} \ln \left ({\mathrm e}^{4 i \left (d x +c \right )}-1\right )}{d}\) | \(67\) |
derivativedivides | \(\frac {a^{4} \left (\tan \left (d x +c \right )-d x -c \right )+4 i a^{4} \ln \left (\cos \left (d x +c \right )\right )-6 a^{4} \left (d x +c \right )+4 i a^{4} \ln \left (\sin \left (d x +c \right )\right )+a^{4} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(80\) |
default | \(\frac {a^{4} \left (\tan \left (d x +c \right )-d x -c \right )+4 i a^{4} \ln \left (\cos \left (d x +c \right )\right )-6 a^{4} \left (d x +c \right )+4 i a^{4} \ln \left (\sin \left (d x +c \right )\right )+a^{4} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(80\) |
norman | \(\frac {\frac {a^{4} \left (\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {a^{4}}{d}-8 a^{4} x \tan \left (d x +c \right )}{\tan \left (d x +c \right )}+\frac {4 i a^{4} \ln \left (\tan \left (d x +c \right )\right )}{d}-\frac {4 i a^{4} \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}\) | \(83\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 67, normalized size = 0.94 \begin {gather*} -\frac {8 \, {\left (d x + c\right )} a^{4} + 4 i \, a^{4} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 4 i \, a^{4} \log \left (\tan \left (d x + c\right )\right ) - a^{4} \tan \left (d x + c\right ) + \frac {a^{4}}{\tan \left (d x + c\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 58, normalized size = 0.82 \begin {gather*} -\frac {4 \, {\left (i \, a^{4} + {\left (-i \, a^{4} e^{\left (4 i \, d x + 4 i \, c\right )} + i \, a^{4}\right )} \log \left (e^{\left (4 i \, d x + 4 i \, c\right )} - 1\right )\right )}}{d e^{\left (4 i \, d x + 4 i \, c\right )} - d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.19, size = 51, normalized size = 0.72 \begin {gather*} - \frac {4 i a^{4}}{d e^{4 i c} e^{4 i d x} - d} + \frac {4 i a^{4} \log {\left (e^{4 i d x} - e^{- 4 i c} \right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 163 vs. \(2 (65) = 130\).
time = 1.02, size = 163, normalized size = 2.30 \begin {gather*} -\frac {-8 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1\right ) + 32 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + i\right ) - 8 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1\right ) - 8 i \, a^{4} \log \left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {-8 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 5 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 8 i \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{4}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.00, size = 63, normalized size = 0.89 \begin {gather*} \frac {a^4\,\mathrm {tan}\left (c+d\,x\right )}{d}-\frac {a^4\,\mathrm {cot}\left (c+d\,x\right )}{d}-\frac {a^4\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,8{}\mathrm {i}}{d}+\frac {a^4\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )\,4{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________